using System;
using System.Collections.Generic;
using System.Text;

namespace MoGameLib
{
    public class SiteCollection : ICollection<Site>
    {
        #region ICollection<Site> Members

        protected List<Site> m_Sites = new List<Site>();

        public void Add(Site item)
        {
            m_Sites.Add(item);
        }

        public void Clear()
        {
            m_Sites.Clear();
        }

        public bool Contains(Site item)
        {
            return m_Sites.Contains(item);
        }

        public void CopyTo(Site[] array, int arrayIndex)
        {
            m_Sites.CopyTo(array, arrayIndex);
        }

        public int Count
        {
            get { return m_Sites.Count; }
        }

        public bool IsReadOnly
        {
            get { return false; }
        }

        public bool Remove(Site item)
        {
            return m_Sites.Remove(item);
        }

        #endregion

        #region IEnumerable<Site> Members

        public IEnumerator<Site> GetEnumerator()
        {
            return m_Sites.GetEnumerator();
        }

        #endregion

        #region IEnumerable Members

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        #endregion

        public Site this[int index]
        {
            get { return m_Sites[index]; }
        }
    }
}
